<template>
  <div class="page cube1">
    <div class="box">
      <div class="cube">
        <div class="front">front</div>
        <div class="back">back</div>
        <div class="left">left</div>
        <div class="right">right</div>
        <div class="top">top</div>
        <div class="bottom">bottom</div>
      </div>
    </div>
  </div>
</template>
<script setup>
import {} from "vue";
</script>
<style lang="scss">
.cube1 {
  div {
    box-sizing: border-box;
  }
  .box, .cube {
    transform-style: preserve-3d;
    margin: 100px auto 0;
  }
  .box {
    transform: rotateX(-35deg);
  }
  .cube, .cube > div {
    height: 200px;
    width: 200px;
  }
  .cube {
    position: relative;
    animation: cube1-trans 6s infinite;
  }
  .cube > div {
    position: absolute;
    left: 0;
    top: 0;
    border: 2px solid white;
    background: rgba(0, 0, 0, .3);
    text-align: center;
    font-size: 50px;
    font-family: 方正启体简体, serif;
    color: white;
    line-height: 200px;
  }
  .front {
    transform: translateZ(100px);
  }
  .back {
    transform: translateZ(-100px) rotateY(180deg);
  }
  .left {
    transform: translateX(-100px) rotateY(-90deg);
  }
  .right {
    transform: translateX(100px) rotateY(90deg);
  }
  .top {
    transform: translateY(-100px) rotateX(90deg);
  }
  .bottom {
    transform: translateY(100px) rotateX(-90deg);
  }
  @keyframes cube1-trans {
    0% {
      transform: rotateY(45deg);
    }
    10% {
      transform: rotateY(135deg);
    }
    25% {
      transform: rotateY(135deg);
    }
    35% {
      transform: rotateY(225deg);
    }
    50% {
      transform: rotateY(225deg);
    }
    60% {
      transform: rotateY(315deg);
    }
    75% {
      transform: rotateY(315deg);
    }
    85% {
      transform: rotateY(405deg);
    }
    100% {
      transform: rotateY(405deg);
    }
  }
}
</style>